/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.model;

import org.jfonia.connect5.basics.BasicValueNode;
import org.jfonia.connect5.basics.MutableValueNode;
import org.jfonia.connect5.intervals.BasicLongInterval;

/**
 *
 * @author Jannes Plyson
 */
public class PerformanceNode extends BasicLongInterval{
    private MutableValueNode<Long> quantizeOffset;
    private MutableValueNode<Integer> pitch; //Midi
    private MutableValueNode<Integer> velocity; //Midi

    public PerformanceNode(long difference){
        setDifference(difference);
        pitch = new BasicValueNode<Integer>(0);
        velocity = new BasicValueNode<Integer>(120);
        quantizeOffset = new BasicValueNode<Long>(0l);
    }    

    public long getQuantizeOffset(){
        return quantizeOffset.getValue();
    }

    public MutableValueNode<Long> getQuantizeOffsetNode(){
        return quantizeOffset;
    }

    public Integer getPitch(){
        return pitch.getValue();
    }

    public MutableValueNode getPitchNode(){
        return pitch;
    }

    public void setPitch(Integer pitch){
        this.pitch.setValue(pitch);
    }

    public int getVelocity(){
        return velocity.getValue();
    }

    public MutableValueNode getVelocityNode(){
        return velocity;
    }

    public void setVelocity(int velocity){
        this.velocity.setValue(velocity);
    }

    @Override
    public PerformanceNode clone(){
        PerformanceNode pn = new PerformanceNode(getDifference());
        pn.setPitch(getPitch());
        pn.setVelocity(getVelocity());
        pn.quantizeOffset.setValue(getQuantizeOffset());
        return pn;
    }
}
